﻿'Params

'api_key (Required) : A Last.fm API key.
'Auth
'This service does not require authentication. 

Public Structure TagGetTopTagsResponse
	Public tags() As Tag
End Structure

Public Class TagGetTopTags
	Inherits BaseRequest

	Public xmlresponse As XDocument = Nothing

	Public Sub New()

	End Sub

	Public Sub sendRequest()
		InitializeMembers("Tag.GetTopTags")
		AddMember("api_key", My.Settings.api_key, False)

		xmlresponse = sendPOSTResponse()
	End Sub

	Public Function getResponse() As TagGetTopTagsResponse
		Dim response As New TagGetTopTagsResponse
		Dim count As Integer

		Try
			count = xmlresponse.<lfm>.<results>.<toptags>.<tag>.Count

		Catch ex As Exception
			Return response
		End Try
		If (count > 0) Then
			ReDim response.tags(count - 1)
			For i As Integer = 0 To count - 1
				response.tags(i) = New Tag(xmlresponse.<lfm>.<toptags>.<tag>(i))
			Next
		End If

		Return response
	End Function
End Class
